<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Company news - Beijing Huateng rubber and plastic latex products Co., Ltd</title>
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/all.min.css">
    <link rel="stylesheet" href="css/style.css">
</head>

<body>
    <div class="flex-container news">
        #include('inc/top_en.html')
        <div class="container-fluid">
            <div class="intobg"></div>
        </div>

        <div class="container text-center pb-2">
            <h2 class="product-title" style="margin-top: 20px;margin-bottom: 12px;">Company News</h2>
            <!--<p class="product-subtitle">公司新闻</p>-->
        </div>
        #--#ArticleEnhancePage(categoryId=1,tagid=2,where=C.get("year") && C.get("year")!="all"?" where date_format(created,'%Y') = '"+C.get("year")+"'":null)--#
        <div class="container-fluid eq-bg">
            <div class="container pt-4 mb-3">
                <div class="row newslist">
                    <div class="col-9 line">
                        <form>
                            <div class="form-row">
                                <div class="col-4">
                                    <select class="form-control" name="year" id="year">
                                        <option value="0">All years</option>
                                        #ArticlePageCustomSQLPage(sql="SELECT DATE_FORMAT(modified,'%Y')as y FROM article GROUP BY DATE_FORMAT(modified,'%Y')")
                                        #for(e : ArticlePageCustomSQLPage.list)
                                        <option value="#(e.y)">#(e.y)</option>
                                        #end
                                        #end
                                    </select>
                                    
                                </div>
                                <div class="col-4">
                                    <input type="button" value="search" onclick="find('year');" class="btn btn-primary">
                                </div>
                            </div>
                        </form>
                       
                        <ul id="app">
                            
                            <li v-for="entry in list">
                                <a :href="entry.url">{{ entry.title }}</a>
                                <span>{{ entry.created }}</span>
                                <p class="content" v-html="entry.summary"></p>
                            </li>
                            
                        </ul>
                        
                        <a href="javascript:next()" class="btn btn-outline-primary">Load more&nbsp;&nbsp;<i class="fas fa-plus-square"></i></a>
                        
                    </div>
                    
                    <div class="col-3 text-secondary pl-4">
                        <!--<h4>北京华腾橡塑乳胶制品有限公司</h4>
                        <p class="title">乳胶</p>
                        <p>电话：+86-10-815025533</p>
                        <p>+86-10-81502536</p>
                        <p>传真：+86-10-81502534</p>
                        <p><a href="mailto:bjlatex@263.net">bjlatex@263.net</a></p>
                        <p><a href="mailto:bjlatex@rubberchina.com">bjlatex@rubberchina.com</a></p>
                        <p><br></p>
                        <p class="title">橡胶（主要类型的塑料片材，制品，钓鱼靴，钓鱼裤）</p>
                        <p>电话：+86-10-81501071</p>
                        <p>+86-10-81501073</p>
                        <p><a href="mailto:plastic@bjkatex.com">plastic@bjkatex.com</a></p>
                        <p><a href="mailto:bjlatex@public.bta.net.cn">bjlatex@public.bta.net.cn</a></p>
                        <p><a href="mailto:beijingrubber@rubberchina.com">beijingrubber@rubberchina.com</a></p>-->
                        #ArticleEnhancePage(categoryId=33,pageSize=3)
                        #for(article : ArticleEnhancePage.list)
                        <div>
                            <p class="title">#(article.title ??)</p>
                            <div>
                                #(article.content ??)
                            </div>
                        </div>
                        <hr>
                        #end
                        #end
                    </div>
                    
                </div>
            </div>
        </div>
        
    </div>
    <!--bottom-->
    #include('inc/footer_en.html')

    <script src="js/jquery-3.3.1.min.js"></script>
    <script src="js/vue.min.js"></script>
    <script src="js/popper.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script>
        
        var page = 1;
        var pageMax;
        
        var app = new Vue({
          el: '#app',
          data: {
              list:[]
          }
        });
        
        function find(id){
            page = 1
            app.list=[];
            getdata(page,$("#"+id).val());
        }
        
        function next(year){
            page++;
            getdata(page,year);
        }
        
        function getdata(p,year){
            var url = "/articleWebApi/getJsonWhereYear";
            pm = {
                    page:p,
                    pageSize:5,
                    categoryId:26,
                    year:year
                
            }
            
            if(pageMax!="" && page > pageMax){
                alert("No more data!")
                return;
            }
            
            $.post(url,pm,function(e){
                
                pageMax = e.totalPage;
                
                for(var i in e.list){
                    app.list.push(e.list[i]);
                }
                
            });
        }
        
        getdata(1,null);
    </script>
</body>

</html>